-- 通用 floatTips

local Equip = require("app.public.dao.Equip")
local Mount = require("app.public.dao.Mount")
local Clothes = require("app.public.dao.Clothes")
local Partner = require("app.public.dao.Partner")
local MountSoul = require("app.public.dao.MountSoul")
local PartnerSoul = require("app.public.dao.PartnerSoul")
local Daibi = require("app.public.dao.Daibi")
local Fame = require("app.public.dao.Fame")
local Tool = require("app.public.dao.Tool")
local Item = require("app.public.dao.Item")
local Mercenary = require("app.public.dao.Mercenary")
local Achievement = require("app.public.dao.Achievement")
local Jewel = require("app.public.dao.Jewel")
local Skill = require("app.public.dao.Skill")
local MapBuff = require("app.public.dao.MapBuff")

local newTitleTipsView = import(".floatSubmodule.newTitleTipsView") -- title tips
local newSkillTitleTipsView = import(".floatSubmodule.newSkillTitleTipsView") -- skill_title tips
local newEquipPropTipsView = import(".floatSubmodule.newEquipPropTipsView") -- 装备属性tips
local newJewelPropView = import(".floatSubmodule.newJewelPropView") -- 镶嵌的珠宝tips
local newCrystalPropView = import(".floatSubmodule.newCrystalPropView") -- 镶嵌的水晶tips
local newCrystalInsertTipsView = import(".floatSubmodule.newCrystalInsertTipsView") -- 镶嵌水晶的提示
local newSuitTipsView = import(".floatSubmodule.newSuitTipsView") -- 套装属性tips
local newSkillTipsView = import(".floatSubmodule.newSkillTipsView") -- 提供的技能增强tuos
local newDescTipsView = import(".floatSubmodule.newDescTipsView") -- 描述tips
local newFashionTipsView = import(".floatSubmodule.newFashionTipsView") -- 幻化/分解描述tips
local newButtonTipsView = import(".floatSubmodule.newButtonTipsView") -- 操作按钮
local newFromBtnView = import(".floatSubmodule.newFromBtnView") -- 操作按钮

local tipOriginWidth = 0 -- tips原始宽度（不算操作按钮）
local opBtnWidth = 0 -- 操作按钮容器宽
local previewBtnWidth = 0 -- 预览按钮容器宽

local newFloatTipsView = class("newFloatTipsView",function()
    return display.newLayer("newFloatTipsView")
end)

function newFloatTipsView:ctor( params )
    assert( nil ~= params, " ------------>>>> newFloatTipsView:ctor 构造函数参数不能为空 " )

    self.mUINode = display.newNode()
    self.mUINode:setAnchorPoint( cc.p( 0, 0 ) )
    self:addChild( self.mUINode )

    -- 预览按钮
    self._previewBtnTips = cc.uiloader:load( Res.Tips_preview )
    local panelTemp = self._previewBtnTips:getChildByName( "Panel" )
    display.uiAddClick( panelTemp, function()
        EM:notify("avatarPreview", self._previewData)
    end, true, 0.02 )
    previewBtnWidth = panelTemp:getContentSize2()
    self._previewBtnTips:setName( "mPreviewBtnNode" )
    self._previewBtnTips:setVisible(false)
    self.mUINode:addChild( self._previewBtnTips )

    self.bg = cc.uiloader:load( Res.Tips_BG )
    tipOriginWidth = self.bg:getChildByName("bg"):getContentSize2()
    -- 默认根据点击去自动隐藏
    if not params.notAutoHide then
        display.nodeRemoveForNotHit( self.bg:getChildByName("bg"), function()
            if self:isVisible() then
                self:hide()
            end
        end )
    end
    self.mUINode:addChild( self.bg )

    self._scrollViewTemp = ccui.ScrollView:create()
    self._scrollViewTemp:setDirection( ccui.ScrollViewDir.vertical )
    self._scrollViewTemp:setSwallowTouches( false )
    self.mUINode:addChild( self._scrollViewTemp )

    -- 通用tips标题
    self._titleTips = newTitleTipsView.new()
    self._titleTips:setName( "mTitleNode" )
    self._scrollViewTemp:addChild( self._titleTips )

    -- 技能tips标题
    self._skillTitleTips = newSkillTitleTipsView.new()
    self._skillTitleTips:setName( "mSkillTitleNode" )
    self._scrollViewTemp:addChild( self._skillTitleTips )

    -- 属性列表
    self._equipPopTips = newEquipPropTipsView.new()
    self._equipPopTips:setName( "mExPropNode" )
    self._scrollViewTemp:addChild( self._equipPopTips )

    -- 宝石列表
    self._jewelPropTips = newJewelPropView.new()
    self._jewelPropTips:setName( "mJewelPropNode" )
    self._scrollViewTemp:addChild( self._jewelPropTips )

    -- 水晶列表
    self._crystalPropTips = newCrystalPropView.new()
    self._crystalPropTips:setName( "mCrystalPropNode" )
    self._scrollViewTemp:addChild( self._crystalPropTips )

    -- 水晶提示
    self._crystalInsertTips = newCrystalInsertTipsView.new()
    self._crystalInsertTips:setName("mCrystalInsertTips")
    self._scrollViewTemp:addChild( self._crystalInsertTips )

    -- 套装
    self._suitTips = newSuitTipsView.new()
    self._suitTips:setName( "mSuitPropNode" )
    self._scrollViewTemp:addChild( self._suitTips )

    -- 额外技能描述
    self._skillTips = newSkillTipsView.new()
    self._skillTips:setName( "mExtraSkillNode" )
    self._scrollViewTemp:addChild( self._skillTips )

    -- 物品描述
    self._descTips = newDescTipsView.new()
    self._descTips:setName( "mDescNode" )
    self._scrollViewTemp:addChild( self._descTips )

    -- 

    -- 分解、绑定状态
    self._fashionTips = newFashionTipsView.new()
    self._fashionTips:setName( "mFashionNode" )
    self._scrollViewTemp:addChild( self._fashionTips )

    -- 来源按钮tips
    self._fromBtnTips = newFromBtnView.new()
    self._fromBtnTips:setName( "mFromBtnNode" )
    self._fromBtnTips:setClickCB( handler( self, self._clickCb ) )
    self._scrollViewTemp:addChild( self._fromBtnTips )

    -- 操作按钮
    self._btnTips = newButtonTipsView.new()
    opBtnWidth = self._btnTips:getContentSize2()
    self._btnTips:setName( "mButtonNode" )
    self.mUINode:addChild( self._btnTips )

    -- 下边距空白
    self._bottom = cc.uiloader:load( Res.Tips_Bottom )
    self._bottom:setName( "mBottomNode" )
    self._scrollViewTemp:addChild( self._bottom )

    self._btnParams = {} -- 操作按钮列表
    self._moduleList = {} -- 子模块列表

    self._extendNodes = {}

    if params then
        self:refreshContent( params )
    end
end

function newFloatTipsView:hide(tp)
    -- print(debug.traceback("", 1))
    self._fromBtnTips:hide()
    self:setVisible(false)
    local cb = self._params.closeCallBack
    self._params.closeCallBack = nil
    if not tp  then
        tp = Enums.TIPS_HIDE.NORMAL
    end
    if cb then
        cb(tp)
    end
end

-- 帮助函数：取装备列表 equips 中 pos == location 的项
local function getEquipFromEquipsByLocation( equips, location )
    local equipTemp = nil
    for k,v in pairs( equips ) do
        if v:getPos() == location then
            equipTemp = v
            break
        end
    end
    return equipTemp
end

function newFloatTipsView:refreshContent( params )
    self._params = nil

    local titleTips = self._titleTips
    local skillTitleTips = self._skillTitleTips
    local equipPropTips = self._equipPopTips
    local jewelPropTips = self._jewelPropTips
    local crystalPropTips = self._crystalPropTips
    local crystalInsertTips = self._crystalInsertTips
    local suitTips = self._suitTips
    local skillTips = self._skillTips
    local descTips = self._descTips
    local fashionTips = self._fashionTips
    local fromBtnTips = self._fromBtnTips
    local btnTips = self._btnTips

    for k, v in pairs(self._extendNodes) do
        v:removeFromParent(true)
    end
    self._extendNodes = {}

    -- 先暂时隐藏所有子模块
    titleTips:setVisible( false )
    skillTitleTips:setVisible( false )
    equipPropTips:setVisible( false )
    jewelPropTips:setVisible( false )
    crystalPropTips:setVisible( false )
    crystalInsertTips:setVisible(false)
    suitTips:setVisible( false )
    skillTips:setVisible( false )
    descTips:setVisible( false )
    fashionTips:setVisible( false )
    fromBtnTips:setVisible( false )
    btnTips:setVisible( false )
    self._bottom:setVisible( false )

    self._moduleList = {}
    if params then -- 有数据？
        self._params = params
        self._params.level = self._params.level or UD:getLevel()

        self._showPreviewBtn = self._params.showPreviewBtn or false
        self._previewData = nil

        if not( self._params.tipsType == Enums.TipsType.task or
            self._params.tipsType == Enums.TipsType.skill or
            self._params.tipsType == Enums.TipsType.classSkill or 
            self._params.tipsType == Enums.TipsType.desc or 
            self._params.tipsType == Enums.TipsType.contents
        ) then -- 非任务、佣兵技能tips都有title
            table.insert( self._moduleList, titleTips )
        end
        if self._params.tipsType == Enums.TipsType.equip then -- 装备？
            self._params.puid = self._params.puid or UD:getUid()
            self._params.equipGrids = self._params.equipGrids or UD:getEquipGrids()
            self._params.equips = self._params.equips or UD.equips
            self._params.class = self._params.class or UD:getClass()
            self._params.specialistId = self._params.specialistId or UD:getCurSpecTypeId()

            if not self._params.dataTemp then
                local equipTemp = Equip.new( true )
                equipTemp:read( { tid = self._params.itemId } )
                self._params.dataTemp = equipTemp
            end
            local dataTemp = self._params.dataTemp

            if self._showPreviewBtn then
                self._showPreviewBtn, self._previewData = dataTemp:isClassAvatarEnable()
            end

            -- title部分
            titleTips:setIconData( dataTemp )
            titleTips:setNameStr( dataTemp:getName(true) )
            titleTips:setNameColor( Enums.QualityColor[ dataTemp.quality ] )
            titleTips:setCombatTltStr( L("lua_code_text_421") )
            titleTips:changeCombatTltColor()

            titleTips:setCombatNumStr( dataTemp:getGearScore() )
            titleTips:setTypeStr(dataTemp:getUserShow() .. dataTemp:getPosName())
            titleTips:setLvStr( string.format( L("tips_3000333"), tostring( dataTemp.useLv ) ) )
            if dataTemp.useLv <= self._params.level then
                titleTips:setLvColor()
            else
                titleTips:setLvColor( display.COLOR_RED )
            end

            local isBelongingToMe = self._params.puid == UD:getUid() -- 是否属于"我"?
            if isBelongingToMe then -- 属于我？
                if self._params.equips[ self._params.uid ] then -- 已装备？
                    titleTips:setEquippedStr( L("tips_3000337") )
                    titleTips:setEquippedColor()
                else
                    local isClassEnable = dataTemp:isClassEnable(self._params.class)

                    local equipedOnPlayer = getEquipFromEquipsByLocation( self._params.equips, dataTemp:getPos() )
                    local isBetter = false
                    if equipedOnPlayer then
                        isBetter = dataTemp:getGearScore() > equipedOnPlayer:getGearScore()
                    else
                        isBetter = true
                    end

                    if isClassEnable and isBetter then -- 可装备、且比身上装备评分高
                        titleTips:setEquippedStr( L("text_10700005") )
                        titleTips:setEquippedColor( display.COLOR_GREEN )
                    else
                        titleTips:setEquippedStr()
                    end
                end
            else
                titleTips:setEquippedStr()
            end
            titleTips:adjustContentSizeAndPos()

            -- 基础属性
            local propShownListTemp = {}
            local strengthenLvTemp = 0 -- 这件装备对应格子的强化信息
            if self._params.equipGrids then -- 存在格子强化信息
                local  equipGrid = self._params.equipGrids[ dataTemp:getPos() ]
                if equipGrid then
                    strengthenLvTemp = equipGrid:getStrengthLevel()
                end
            end
            for k,v in pairs( dataTemp:getStrengthAttr( strengthenLvTemp ) ) do
                local attrName, attrNum = UD:formatAttr( k, v )
                table.insert( propShownListTemp, { attrName, attrNum } )
            end
            -- 附加属性
            local numOfValidExtraAttr = 0
            for i,v in ipairs( dataTemp.extraProps ) do
                local attrName, attrNum = UD:formatAttr( v.propID, v.val )
                local attrColor = Enums.QualityColor[ tonumber( dataTemp:getExtraAttrQualityByPropid( v.propID ) ) ]
                table.insert( propShownListTemp, { attrName, attrNum, attrColor } )
                numOfValidExtraAttr = numOfValidExtraAttr + 1
            end

            local extraAttrNum = dataTemp:getExtraAttrNum()
            if numOfValidExtraAttr < extraAttrNum then -- 存在空槽？
                for i = 1, ( extraAttrNum - numOfValidExtraAttr ) do
                    local attrName, attrNum = L("lua_code_text_226"), ""
                    local attrColor = cc.c3b( 68, 68, 68 )
                    table.insert( propShownListTemp, { attrName, attrNum, attrColor } )
                end
            end
            
            if #propShownListTemp >0 then
                equipPropTips:setEquipAttrTipsData( propShownListTemp )
                table.insert( self._moduleList, equipPropTips )
            end
            
            if dataTemp:canSetJewel() then -- 有宝石槽位？
                table.insert( self._moduleList, jewelPropTips )
                jewelPropTips:refreshContent( dataTemp:getAllSlots() )
            end

            if dataTemp:getRockNum() > 0 then
                table.insert( self._moduleList, crystalPropTips )
                crystalPropTips:refreshContent( dataTemp:getAllCrystalSlots(), dataTemp:getRockNum())
            end

            if dataTemp:getSuit() then -- 套装组件？
                table.insert( self._moduleList, suitTips )
                suitTips:setSuitAttrTipsData( dataTemp, self._params.equips, self._params.specialistId )
            end

            local classSkill = dataTemp:getClassSkill()
            if classSkill then -- 附带增益技能
                table.insert( self._moduleList, skillTips )
                local calssSkillConf = GD:getClassSkill( classSkill )
                skillTips:setSkillTipsData( L( calssSkillConf.des ) or "" )
            end

            local desc = dataTemp:getDesc()
            if desc ~= "" then
                table.insert( self._moduleList, descTips )
                descTips:setContentText( desc )
            end

            if dataTemp:isCanBreak() or ( dataTemp.bindType and 99 ~= dataTemp.bindType ) then -- 可分解 | 存在绑定状态
                table.insert( self._moduleList, fashionTips )
                fashionTips:setBindStr()
                if dataTemp:isBind() then -- 已绑定？
                    fashionTips:setBindStr( L("binded") )
                else
                    if dataTemp.bindType then
                        if 1 == dataTemp.bindType then
                            fashionTips:setBindStr( L("takebinding") )
                        elseif 2 == dataTemp.bindType then
                            fashionTips:setBindStr( L("equipbinding") )
                        else
                            fashionTips:setBindStr( L("tradable") )
                        end
                    else
                        fashionTips:setBindStr( L("tradable") )
                    end
                end
                local strs = {}
                local icons = {}
                local breakParams = dataTemp:getBreakParamsByConf()     --存在多个分解产物
                if breakParams then
                    for _, v in ipairs(breakParams) do
                        local item = UD:parseRewardToBagItem(v)
                        if item then
                            table.insert(strs, item.amount)
                            table.insert(icons, item:getIcon())
                        end
                    end
                end

                if #strs > 0 and #icons > 0 then
                    fashionTips:setTltStr(strs)
                    fashionTips:setIcon(icons)
                else
                    fashionTips:setTltStr()
                    fashionTips:setIcon()
                end
            end
            -- 不显示绑定
            if self._params.unShowBind then
                fashionTips:setBindStr()
            end
            -- 来源panel
            if not self._params.unShowOrigin then
                local _getResource = dataTemp:getResource()
                if _getResource then -- 存在掉落来源？
                    table.insert( self._moduleList, fromBtnTips )
                end
                fromBtnTips:refreshContent( _getResource )
            end
        elseif self._params.tipsType ==  Enums.TipsType.mount then -- 坐骑？
            if not self._params.dataTemp then
                local mountTemp = Mount.new()
                mountTemp:read( { tid = self._params.itemId } )
                self._params.dataTemp = mountTemp
            end
            local dataTemp = self._params.dataTemp

            if self._showPreviewBtn then
                self._showPreviewBtn, self._previewData = dataTemp:isClassAvatarEnable()
            end

            -- title部分
            titleTips:setIconData( dataTemp )
            titleTips:setNameStr( dataTemp:getName() )
            titleTips:setNameColor( Enums.QualityColor[ dataTemp:getQuality() ] )

            titleTips:setCombatTltStr()
            titleTips:setCombatNumStr()
            titleTips:setEquippedStr()
            titleTips:setTypeStr(dataTemp:getTypeName())
            titleTips:setLvStr()

            titleTips:adjustContentSizeAndPos()

            
            local propList = dataTemp:getAttrs()
            local propShownListTemp = {}
            for k,v in pairs( propList ) do
                local attrName, attrNum = UD:formatAttr( k, v )
                table.insert( propShownListTemp, { attrName, attrNum } )
            end
            
            if #propShownListTemp > 0 then
                equipPropTips:setEquipAttrTipsData( propShownListTemp )
                table.insert( self._moduleList, equipPropTips )
            end
            

            -- 附带增益技能
            local desc = dataTemp:getSkillDesc()
            if desc and desc ~= "" then
                skillTips:setSkillTipsData(string.format(L("skillDesc"),desc))
                skillTips:setTextColor(cc.c3b( 196, 169, 100 ))
                table.insert( self._moduleList, skillTips )
            end


            table.insert( self._moduleList, descTips )
            descTips:setContentText( dataTemp:getDesc() )

            -- 来源panel
            if not self._params.unShowOrigin then
                local _getResource = dataTemp:getResource()
                if _getResource then -- 存在掉落来源？
                    table.insert( self._moduleList, fromBtnTips )
                end
                fromBtnTips:refreshContent( _getResource )
            end
        elseif self._params.tipsType ==  Enums.TipsType.fashion then -- 时装
            if not self._params.dataTemp then
                local clothTemp = Clothes.new()
                clothTemp:read( { tid = self._params.itemId } )
                self._params.dataTemp = clothTemp
            end
            local dataTemp = self._params.dataTemp
            --预览
            if self._showPreviewBtn then
                self._showPreviewBtn, self._previewData = dataTemp:isClassAvatarEnable()
            end

            -- title部分
            titleTips:setIconData( dataTemp )
            titleTips:setNameStr( dataTemp:getName() )
            titleTips:setNameColor( Enums.QualityColor[ dataTemp:getQuality() ] )

            titleTips:setCombatTltStr()
            titleTips:setCombatNumStr()
            titleTips:setEquippedStr()
            titleTips:setTypeStr(dataTemp:getTypeName())
            titleTips:setLvStr()

            titleTips:adjustContentSizeAndPos()
            table.insert( self._moduleList, descTips )
            descTips:setContentText( dataTemp:getDesc() )

            -- 来源panel
            if not self._params.unShowOrigin then
                local _getResource = dataTemp:getResource()
                if _getResource then -- 存在掉落来源？
                    table.insert( self._moduleList, fromBtnTips )
                end
                fromBtnTips:refreshContent( _getResource )
            end

        elseif self._params.tipsType ==  Enums.TipsType.partner then -- 随从
            if not self._params.dataTemp then
                local partnerTemp = Partner.new()
                partnerTemp:initWithId(self._params.itemId)
                self._params.dataTemp = partnerTemp
            end
            local dataTemp = self._params.dataTemp
            --预览暂时不做
            if self._showPreviewBtn then
                self._showPreviewBtn, self._previewData = dataTemp:isClassAvatarEnable()
            end

            -- title部分
            titleTips:setIconData( dataTemp )
            titleTips:setNameStr( dataTemp:getName() )
            titleTips:setNameColor( dataTemp:getQualityColor() )

            titleTips:setCombatTltStr()
            titleTips:setCombatNumStr()
            titleTips:setEquippedStr()
            titleTips:setTypeStr(dataTemp:getTypeName())
            titleTips:setLvStr()
            titleTips:adjustContentSizeAndPos()

            if self._params.contents then
                for k , v in ipairs(self._params.contents) do
                    local newDescTips = newDescTipsView.new()
                    self._scrollViewTemp:addChild( newDescTips )
                    table.insert(self._extendNodes, newDescTips)
                    newDescTips:setExtendTexts( v, self._params.offerY)
                    table.insert( self._moduleList, newDescTips )
                end
            end

            table.insert( self._moduleList, descTips )
            descTips:setContentText( dataTemp:getDesc() )

            -- 来源panel
            if not self._params.unShowOrigin then
                local _getResource = dataTemp:getResource()
                if _getResource then -- 存在掉落来源？
                    table.insert( self._moduleList, fromBtnTips )
                end
                fromBtnTips:refreshContent( _getResource )
            end

        elseif self._params.tipsType ==  Enums.TipsType.daibi then -- 代币？
            if not self._params.dataTemp then
                local itemTemp = Daibi.new()
                itemTemp:read( { tid = self._params.itemId, amount = 0 } )

                self._params.dataTemp = itemTemp
            end
            local dataTemp = self._params.dataTemp

            titleTips:setIconData( dataTemp )
            titleTips:setNameStr( dataTemp:getName() )
            titleTips:setNameColor( Enums.QualityColor[ dataTemp:getQuality() ] )
            titleTips:setTypeStr( dataTemp:getTypeName() )

            titleTips:setLvStr()
            titleTips:setCombatTltStr()
            titleTips:setCombatNumStr()
            titleTips:setEquippedStr()
            titleTips:adjustContentSizeAndPos()

            table.insert( self._moduleList, descTips )
            descTips:setContentText( dataTemp:getDesc() )
        elseif self._params.tipsType ==  Enums.TipsType.fame then -- 声望？
            if not self._params.dataTemp then
                local itemTemp = Fame.new()
                itemTemp:read( {uid=self._params.itemId, level=1, exp=0} )

                self._params.dataTemp = itemTemp
                self._params.dataTemp:setAmount(0)
            end
            local dataTemp = self._params.dataTemp

            titleTips:setIconData( dataTemp )
            titleTips:setNameStr( dataTemp:getName(true) )
            titleTips:setNameColor( Enums.QualityColor[ dataTemp:getQuality() ] )
            titleTips:setTypeStr( dataTemp:getTypeName() )

            titleTips:setLvStr()
            titleTips:setCombatTltStr()
            titleTips:setCombatNumStr()
            titleTips:setEquippedStr()
            titleTips:adjustContentSizeAndPos()

            table.insert( self._moduleList, descTips )
            descTips:setContentText( dataTemp:getDesc() )
        elseif self._params.tipsType ==  Enums.TipsType.mountSoul then -- 坐骑灵魂石
            if not self._params.dataTemp then
                local itemTemp = MountSoul.new()
                itemTemp:read( {id=self._params.itemId, num=1} )

                self._params.dataTemp = itemTemp
            end
            local dataTemp = self._params.dataTemp

            titleTips:setIconData( dataTemp )
            titleTips:setNameStr( dataTemp:getName(true) )
            titleTips:setNameColor( Enums.QualityColor[ dataTemp:getQuality() ] )
            titleTips:setTypeStr( dataTemp:getTypeName() )

            titleTips:setLvStr()
            titleTips:setCombatTltStr()
            titleTips:setCombatNumStr()
            titleTips:setEquippedStr()
            titleTips:adjustContentSizeAndPos()

            table.insert( self._moduleList, descTips )
            descTips:setContentText( dataTemp:getDesc() )
       elseif self._params.tipsType ==  Enums.TipsType.partnerSoul then --随从灵魂石
            if not self._params.dataTemp then
                local itemTemp = PartnerSoul.new()
                itemTemp:read( {id=self._params.itemId, num=1} )

                self._params.dataTemp = itemTemp
            end
            local dataTemp = self._params.dataTemp

            titleTips:setIconData( dataTemp )
            titleTips:setNameStr( dataTemp:getName(true) )
            titleTips:setNameColor( Enums.QualityColor[ dataTemp:getQuality() ] )
            titleTips:setTypeStr( dataTemp:getTypeName() )

            titleTips:setLvStr()
            titleTips:setCombatTltStr()
            titleTips:setCombatNumStr()
            titleTips:setEquippedStr()
            titleTips:adjustContentSizeAndPos()

            table.insert( self._moduleList, descTips )
            descTips:setContentText( dataTemp:getDesc() )
        elseif self._params.tipsType == Enums.TipsType.mapBuff then -- mapbuff
            if not self._params.dataTemp then
                local itemTemp = MapBuff.new()
                itemTemp:read( { tid = self._params.itemId} )
                itemTemp:setAmount(self._params:getAmount())

                self._params.dataTemp = itemTemp
            end
            local dataTemp = self._params.dataTemp

            titleTips:setIconData( dataTemp )
            titleTips:setNameStr( dataTemp:getName() )
            titleTips:setNameColor( Enums.QualityColor[ dataTemp:getQuality() ] )
            titleTips:setTypeStr()

            titleTips:setLvStr()
            titleTips:setCombatTltStr()
            titleTips:setCombatNumStr()
            titleTips:setEquippedStr()
            titleTips:adjustContentSizeAndPos()

            table.insert( self._moduleList, descTips )
            descTips:setContentText( dataTemp:getDesc() )
        elseif self._params.tipsType ==  Enums.TipsType.task then -- 任务？
        elseif self._params.tipsType ==  Enums.TipsType.tool then -- 工具？
        elseif self._params.tipsType ==  Enums.TipsType.item then -- 道具？
            if not self._params.dataTemp then
                local itemTemp = Item.new( Enums.ItemBagType.item )
                itemTemp:read( { tid = self._params.itemId, amount = 1 } )
                self._params.dataTemp = itemTemp
            end
            local dataTemp = self._params.dataTemp

            if self._showPreviewBtn then
                self._showPreviewBtn, self._previewData = dataTemp:isClassAvatarEnable()
            end

            titleTips:setIconData( dataTemp )
            titleTips:setNameStr( dataTemp:getName(true) )
            titleTips:setNameColor( Enums.QualityColor[ dataTemp.quality ] )
            titleTips:setTypeStr( dataTemp:getTypeName() )
            titleTips:setLvStr()
            titleTips:setLvColor()

            titleTips:setCombatTltStr()
            titleTips:setCombatNumStr()
            titleTips:setEquippedStr()
            titleTips:adjustContentSizeAndPos()

            if self._params.contents then --目前只有光铸金币需要处理                
                table.insert( self._moduleList, descTips )
                descTips:setExtendTexts( self._params.contents, self._params.offerY)
            else
                table.insert( self._moduleList, descTips )
                descTips:setContentText( dataTemp:getDesc() )
            end

            --如果是水晶
            if dataTemp:getItemType() == Enums.ItemType.crystal and
                    self._params.equipUid then
                table.insert( self._moduleList, crystalInsertTips )
                crystalInsertTips:refreshContent(self._params.haveEnoughTypeRock,L("rockTips_5"),L("rockTips_6"))
            end

            if dataTemp:isCanBreak() or ( dataTemp.bindType and 99 ~= dataTemp.bindType ) then -- 可分解 | 存在绑定状态
                table.insert( self._moduleList, fashionTips )
                fashionTips:setBindStr()
                if dataTemp:isBind() then -- 已绑定？
                    fashionTips:setBindStr( L("binded") )
                else
                    if dataTemp.bindType then
                        if 1 == dataTemp.bindType then
                            fashionTips:setBindStr( L("takebinding") )
                        elseif 2 == dataTemp.bindType then
                            fashionTips:setBindStr( L("equipbinding") )
                        else
                            fashionTips:setBindStr( L("tradable") )
                        end
                    else
                        fashionTips:setBindStr( L("tradable") )
                    end
                end
                if dataTemp:isCanBreak() then
                    local itemData = UD:parseRewardToBagItem( dataTemp:getBreakStr() )
                    if itemData then
                        fashionTips:setTltStr(string.format(L("lua_code_text_446"), itemData:getAmount()))
                        fashionTips:setIcon( itemData:getIcon() )
                    else
                        fashionTips:setTltStr()
                        fashionTips:setIcon()
                    end
                else
                    fashionTips:setTltStr()
                    fashionTips:setIcon()
                end
            end
            -- 不显示绑定
            if self._params.unShowBind then
                fashionTips:setBindStr()
            end
            -- 来源panel
            if not self._params.unShowOrigin then
                local _getResource = dataTemp:getResource()
                if _getResource then -- 存在掉落来源？
                    table.insert( self._moduleList, fromBtnTips )
                end
                fromBtnTips:refreshContent( _getResource )
            end
        elseif self._params.tipsType ==  Enums.TipsType.mercenary then -- 宠物？
        elseif self._params.tipsType ==  Enums.TipsType.buff then -- buff(烤肉)？
        elseif self._params.tipsType ==  Enums.TipsType.achieve then -- 成就？
            local achCfg = nil
            if AchievementManager and AchievementManager.achMap then
                achCfg = GD:getAchievementConfigByID(checknumber(self._params.itemId)) --AchievementManager.achMap[self._params.itemId]
            end
            if achCfg then
                -- titleTips
                titleTips:setNameStr( L(achCfg.name) )
                titleTips:setNameColor(cc.c3b(87, 174, 239))
                titleTips:setIconKuang(Res.Qulity_Icon_Bg[3]) -- 成就默认用蓝色品质框
                titleTips:setTypeStr( L("lua_code_text_259") )
                if self._params.status > 0 then
                    titleTips:setLvStr(L("lua_code_text_253"))
                    titleTips:setLvColor(cc.c3b(117, 211, 124))
                else
                    titleTips:setLvStr(L("lua_code_text_74"))
                    titleTips:setLvColor(cc.c3b(178, 178, 178))
                    titleTips._type:setTextColor(cc.c3b(178, 178, 178))
                end

                table.insert( self._moduleList, descTips )
                descTips:setContentText( L(achCfg.desc) )
                titleTips._icon:findChild("Panel/Panel_num"):hide()
                titleTips._icon:findChild("Panel/level"):hide()
                titleTips._icon:findChild("Panel/selected"):hide()
                titleTips._icon:findChild("Panel/icon"):loadTexture("art/achieve/"..achCfg.icon..".png")
                titleTips._icon:findChild("Panel/icon"):show()
            else
                return
            end
            titleTips:setCombatTltStr()
            titleTips:setCombatNumStr()
            titleTips:setEquippedStr()
            titleTips:adjustContentSizeAndPos()
        elseif self._params.tipsType ==  Enums.TipsType.jewel then -- 宝石？
            if not self._params.dataTemp then
                local jewelTemp = Jewel.new()
                jewelTemp:read( { tid = self._params.itemId } )

                self._params.dataTemp = jewelTemp
            end
            local dataTemp = self._params.dataTemp

            titleTips:setIconData( dataTemp )
            titleTips:setNameStr( dataTemp:getName(true) )
            titleTips:setNameColor( Enums.QualityColor[ dataTemp.quality ] )

            if 1 == dataTemp.type then
                titleTips:setTypeStr( L("lua_code_text_265") )
            elseif 2 == dataTemp.type then
                titleTips:setTypeStr( L("lua_code_text_482") )
            else
                titleTips:setTypeStr()
            end
            titleTips:setLvStr( string.format( L("lua_code_text_340"), dataTemp.useLv ) )
            if dataTemp.useLv <= self._params.level then
                titleTips:setLvColor()
            else
                titleTips:setLvColor( display.COLOR_RED )
            end

            titleTips:setCombatTltStr(L("lua_code_text_421"))
            titleTips:setCombatNumStr(dataTemp:getGearScore())
            titleTips:setEquippedStr()
            titleTips:adjustContentSizeAndPos()

            local propShownListTemp = {}
            local attrName, attrNum = UD:formatAttr( dataTemp:getAttrType(), dataTemp:getAttrVal() )
            table.insert( propShownListTemp, { attrName, attrNum } )

            if #propShownListTemp > 0 then
                equipPropTips:setEquipAttrTipsData( propShownListTemp )
                table.insert( self._moduleList, equipPropTips )
            end

            table.insert( self._moduleList, descTips )
            descTips:setContentText( dataTemp:getPosDesc() )

            -- 来源panel
            if not self._params.unShowOrigin then
                local _getResource = dataTemp:getResource()
                if _getResource then -- 存在掉落来源？
                    table.insert( self._moduleList, fromBtnTips )
                end
                fromBtnTips:refreshContent( _getResource )
            end
        elseif self._params.tipsType ==  Enums.TipsType.classSkill then -- classSkill表 技能？
            if not self._params.dataTemp then
                local skillTemp = Skill.new()
                skillTemp:read( { uid = self._params.itemId } )
                self._params.dataTemp = skillTemp
            end
            local dataTemp = self._params.dataTemp
            table.insert( self._moduleList, skillTitleTips )
            skillTitleTips:refreshClassSkillContent( dataTemp )

            table.insert( self._moduleList, descTips )
            descTips:setContentText( dataTemp:getDes() )
        elseif self._params.tipsType ==  Enums.TipsType.skill then -- skill表 技能？
            assert( self._params.dataTemp, " ------->>>>>>> 佣兵技能tips必须外部传入dataTemp " )

            table.insert( self._moduleList, skillTitleTips )
            skillTitleTips:refreshContent( self._params.dataTemp )

            table.insert( self._moduleList, descTips )
            descTips:setContentText( self._params.dataTemp:getDesc() )
        elseif self._params.tipsType == Enums.TipsType.mapBuff then
        elseif self._params.tipsType == Enums.TipsType.desc then
            if self._params.title then
                table.insert( self._moduleList, descTips )
                descTips:setContentText( self._params.title or "" )
            end
            if self._params.content then
                table.insert( self._moduleList, skillTips )
                skillTips:setSkillTipsData( self._params.content or "" )
            end
        elseif self._params.tipsType == Enums.TipsType.contents then
            if self._params.contents then
                for k , v in pairs(self._params.contents) do
                    if k > 1 then  
                        local newDescTips = newDescTipsView.new()
                        self._scrollViewTemp:addChild( newDescTips )
                        table.insert(self._extendNodes, newDescTips)
                        newDescTips:setExtendTexts( v, self._params.offerY)
                        table.insert( self._moduleList, newDescTips )
                    else
                        table.insert( self._moduleList, descTips )
                        descTips:setExtendTexts( v, self._params.offerY)
                    end
                end
            end
            
        elseif self._params.tipsType == Enums.TipsType.partnerEquip then -- 装备？
                local dataTemp = self._params.dataTemp
                -- title部分
                titleTips:setIconData( dataTemp )
                titleTips:setNameStr( dataTemp:getName(true) )
                titleTips:setNameColor( Enums.QualityColor[ dataTemp:getQuality() ] )
                -- titleTips:setTypeStr(dataTemp:getName() .. dataTemp:getlocationString())
                titleTips:setEquippedStr("")
                titleTips:setTypeStr()
                titleTips:setLvStr("")
                titleTips:setCombatTltStr(L("itemTypeDes_21"))
                titleTips:setCombatTltColor(cc.c3b(183,183,183))
                if dataTemp:isUnlock() then
                    titleTips:setTypeStr(L("lua_code_text_94"))
                else
                    titleTips:setTypeStr(L("lua_code_text_124"))
                end
                titleTips:setCombatNumStr("")
                titleTips:adjustContentSizeAndPos()
                -- 基础属性
                local propShownListTemp = {}
                local props = dataTemp:getCurStrengthenPropShowData()
                for k, v in pairs(props) do
                    table.insert( propShownListTemp, { v.name, v.value } )
                end
                if #propShownListTemp >0 then
                    equipPropTips:setEquipAttrTipsData( propShownListTemp )
                    table.insert( self._moduleList, equipPropTips )
                end

                local desc = dataTemp:getDesc()
                if desc ~= "" then
                    table.insert( self._moduleList, descTips )
                    descTips:setContentText( desc )
                end
                -- 来源panel
                if not self._params.unShowOrigin then
                    local _getResource = dataTemp:getResource()
                    if _getResource then -- 存在掉落来源？
                        table.insert( self._moduleList, fromBtnTips )
                    end
                    fromBtnTips:refreshContent( _getResource )
                end
                
        end

        table.insert( self._moduleList, self._bottom ) -- 增加下边距panel
        if not self._params.shownOPbtn then -- 默认显示操作按钮
            table.insert( self._moduleList, btnTips )
        end
        -- 重置可见性
        for i,v in ipairs( self._moduleList ) do
            v:setVisible( true )
        end

        self:refreshBtnStatus()
    end
end

-- 刷新按钮状态
function newFloatTipsView:refreshBtnStatus()
    -- 预览外显
    self._previewBtnTips:setVisible(self._showPreviewBtn)

    self._btnParams = {}

    --右按钮也加入self.buttonParams
    if self._params.useCallback
        and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_TIPS_USE ) then
        table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_TIPS_USE,
            btnNodeName = "Button_use",
            btnName = L("tips_1000017"),
            callback = function() self._params.useCallback( self._params.itemId ) end } )
    end
    -- 鉴定
    if self._params.identifyCallback and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_IDENTIFICATION ) then
        table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_IDENTIFICATION,
            btnNodeName = "Button_identify",
            btnName = L("text_10300010"),
            identifyCost = self._params.identifyCost, callback = function() self._params.identifyCallback( self._params.itemId ) end } )
    end
    -- 装备
    if self._params.equipCallback
        and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_TIPS_EQUIP ) then
        table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_TIPS_EQUIP,
            btnNodeName = "Button_equip",
            btnName = L("tips_1000037"),
            callback = function() self._params.equipCallback( self._params.itemId ) end } )
    end
    -- 卸载
    if self._params.unequipCallback
        and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_TIPS_UNEQUIP ) then
        table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_TIPS_UNEQUIP,
            btnNodeName = "Button_unequip",
            btnName= L("tips_1000038"),
            callback = function() self._params.unequipCallback( self._params.itemId ) end } )
    end
    -- 强化
    if self._params.strengthenCallback
        and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_TIPS_STRENGTHEN ) then
        table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_TIPS_STRENGTHEN,
            btnNodeName = "Button_strengthen",
            btnName = L("lua_code_text_41"),
            callback = function() self._params.strengthenCallback( self._params.itemId ) end } )
    end

    -- 随从装备强化
    if self._params.partnerEquipstrengthenCallback then
        -- and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_PARTNER_EQUIP_STRENGTHEN ) then
        table.insert( self._btnParams, {
            -- btnFuncId = Constant.FUNC_TYPE_PARTNER_EQUIP_STRENGTHEN,
            icon = "common_btn_tip2",
            btnNodeName = "Button_strengthen",
            btnName = L("lua_code_text_41"),
            callback = function() self._params.partnerEquipstrengthenCallback( self._params.dataTemp ) end } )
    end

    -- 镶嵌
    if self._params.slotCallback
        and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_TIPS_SETJEWEL ) then
        table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_TIPS_SETJEWEL,
            btnNodeName = "Button_slot",
            btnName = L("text_11600013"),
            callback = function() self._params.slotCallback( self._params.itemId ) end } )
    end
    -- 属性转移
    if self._params.attrTransCallback
        and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_TIPS_TRANSATTR ) then
        table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_TIPS_TRANSATTR,
            btnNodeName = "Button_attrTrans",
            btnName = L("lua_code_text_68"),
            callback = function() self._params.attrTransCallback( self._params.itemId ) end } )
    end
    -- 宝石升级
    if self._params.upgradeCallback
        and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_TIPS_JEWELLVUP ) then
        table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_TIPS_JEWELLVUP,
            btnNodeName = "Button_jewelLvUp",
            btnName = L("text_11400020"),
            callback = function() self._params.upgradeCallback( self._params.uid ) end } )
    end

    -- 宝石转换
    if self._params.transformCallback 
        and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_TIPS_JEWEL_TRANSFORM ) then
        table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_TIPS_JEWEL_TRANSFORM,
            btnNodeName = "Button_jewelLvUp",
            btnName = L("recast"),
            callback = function() self._params.transformCallback( self._params.uid ) end } )
    end

    --水晶升级
    if self._params.crystalUpgradeCallback
        and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_TIPS_CRYSTAL_LVUP ) then
        table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_TIPS_CRYSTAL_LVUP,
            btnNodeName = "Button_crystalLvUp",
            btnName = L("text_11400030"),
            callback = function() self._params.crystalUpgradeCallback( self._params.uid ) end } )
    end

    --水晶镶嵌
    if self._params.crystalInlayCallback
        and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_TIPS_CRYSTAL_INLAY ) then
        table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_TIPS_CRYSTAL_INLAY,
            btnNodeName = "Button_crystalInlay",
            btnName = L("text_11600013"),
            callback = function() self._params.crystalInlayCallback( self._params.uid ) end } )
    end

    --水晶从装备上卸下
    if self._params.crystalTakeOutCallback
        and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_TIPS_CRYSTAL_INLAY ) then
        table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_TIPS_CRYSTAL_INLAY,
            btnNodeName = "Button_crystalTakeOut",
            btnName = L("takeout"),
            callback = function() self._params.crystalTakeOutCallback( self._params.equipUid, self._params.itemId ) end } )
    end

    --水晶直接镶嵌到装备上
    if self._params.crystalInlayIndirectCallback
    and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_TIPS_CRYSTAL_INLAY ) then
        table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_TIPS_CRYSTAL_INLAY,
            btnNodeName = "Button_crystalInlayIndirect",
            btnName = L("text_11600013"),
            callback = function() self._params.crystalInlayIndirectCallback( self._params.equipUid, self._params.itemId, self._params.uid) end } )
    end

    --拍卖
    if self._params.auctionCallback and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_TIPS_AUCTIONSHOP ) then
      table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_TIPS_AUCTIONSHOP,
            btnNodeName = "Button_auction",
            btnName = L("tips_1000039"),
            callback = function() self._params.auctionCallback() end } )
    end

    -- 分解
    if self._params.decomposeCallback
        and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_TIPS_DECOMPOSE ) then
        table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_TIPS_DECOMPOSE,
            btnNodeName = "Button_decompose" ,
            btnName = L("tips_1000018"),
            callback = function() self._params.decomposeCallback( self._params.itemId ) end } )
    end
    -- 移除幻化
    if self._params.removeIllusionCallback then
        table.insert( self._btnParams, { btnNodeName = "Button_removeIllusion", btnName = L("lua_code_text_250"),
            callback = function() self._params.removeIllusionCallback( self._params.itemId ) end } )
    end

    --追踪回调(现在叫兑换)
    if self._params.trackCallback then
        table.insert( self._btnParams, { 
            btnFuncId = Constant.FUNC_TYPE_TIPS_EXCHANGE,
            btnNodeName = "Button_exchange",
            btnName = L("tips_1000040"),
            callback = function() self._params.trackCallback( self._params.itemId ) end } )
    end

    --跳转回调
    if self._params.jumpCallback then
        table.insert( self._btnParams, { btnName = L("text_10200025"),
            callback = function() self._params.jumpCallback( self._params.itemId ) end } )
    end

    --出售回调
    if self._params.sellCallback and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_SELL_ITEM ) then
        table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_SELL_ITEM,
            btnNodeName = "Button_use" ,
            btnName = L("tips_1000019"),
            callback = function() self._params.sellCallback( self._params.itemId ) end } )
    end

    --分享
    if self._params.uid and
        ( self._params.tipsType == Enums.TipsType.item
            or self._params.tipsType == Enums.TipsType.equip )
        and UIHandler:isFunctionOpen( Constant.FUNC_TYPE_TIPS_SHOW_ITEM ) then

        local tipsType = self._params.tipsType
        local tid = self._params.itemId
        local uid = self._params.uid
        local puid = self._params.puid

        local function shareCallback()
            app:sendMsg("IMRoomController", "shareItem", tipsType, tid, uid, puid)
            self:hide()
        end
        table.insert( self._btnParams, {
            btnFuncId = Constant.FUNC_TYPE_TIPS_SHOW_ITEM,
            btnNodeName = "Button_share" ,
            btnName = L("share"),
            callback = shareCallback } )
    end
    self._btnTips:refreshContent( self._btnParams )
    -- 调整位置
    self:adjustPos()
end

function newFloatTipsView:adjustPos()
    local totalHeight = 0
    local modulesNum = #self._moduleList
    for i = modulesNum, 1, -1 do
        local v = self._moduleList[i]
        if v:getName() ~="mButtonNode" then
            local _, sizeHeight = v:getContentSize2()
            v:setPositionY( totalHeight )
            totalHeight = totalHeight + sizeHeight
        else
            v:setPositionY( 0 )
        end
    end

    local mUINodeWidth = tipOriginWidth
    if self._btnTips:isVisible() and 0 < #self._btnParams then -- 操作按钮可见、且存在可操作按钮
        if totalHeight > display.height then
            self._btnTips:setPositionY( display.height + 2 )
        else
            self._btnTips:setPositionY( totalHeight + 2 )
        end
        mUINodeWidth =  mUINodeWidth + opBtnWidth
    end
    if self._previewBtnTips:isVisible() then
        if totalHeight > display.height then
            self._previewBtnTips:setPositionY( display.height + 2 )
        else
            self._previewBtnTips:setPositionY( totalHeight + 2 )
        end
        mUINodeWidth =  mUINodeWidth + previewBtnWidth
    end

    if totalHeight > display.height then -- 高度超过屏幕高？
        self.mUINode:setContentSize( cc.size( mUINodeWidth, display.height ) )
        self._scrollViewTemp:setTouchEnabled( true )
        self._scrollViewTemp:setContentSize( cc.size( mUINodeWidth, display.height ) )
        self._scrollViewTemp:setClippingEnabled( true )

        self._btnTips:adjust(mUINodeWidth, display.height)
    else
        self.mUINode:setContentSize( cc.size( mUINodeWidth, totalHeight ) )
        self._scrollViewTemp:setTouchEnabled( false )
        self._scrollViewTemp:setContentSize( cc.size( mUINodeWidth, totalHeight ) )
        self._scrollViewTemp:setClippingEnabled( false )

        self._btnTips:adjust(mUINodeWidth, totalHeight)
    end
    self._scrollViewTemp:getInnerContainer():setContentSize( cc.size( mUINodeWidth, totalHeight ) )
    local _, scrollViewheight = self._scrollViewTemp:getContentSize2()
    self._scrollViewTemp:getInnerContainer():setPositionY( scrollViewheight - totalHeight )
    self.bg:setContentSize( cc.size( tipOriginWidth,totalHeight + 2 ) )
    self.bg:getChildByName("bg"):setContentSize( cc.size( tipOriginWidth, totalHeight + 2 ) )
    self.bg:setPositionY( -2 )

    if self._params.boundingBox then
        if self._previewBtnTips:isVisible() then
            display.adjustNodePos( self._params.boundingBox, self.mUINode, 10 - previewBtnWidth)
        else
            display.adjustNodePos( self._params.boundingBox, self.mUINode, 10 )
        end
    else
        local posX = 0
        local posY = 0
        if self._params.fromX then -- 点击响应posX
            if self._params.fromX < display.width/2 then -- 点击屏幕左半区？
                posX = self._params.fromX
            else
                posX = self._params.fromX  - mUINodeWidth
            end
        end
        if self._params.fromY then -- 点击响应posY
            if totalHeight > display.height then
                posY = self._params.fromY - display.height
            else
                posY = self._params.fromY - totalHeight
            end
            if 10 > posY then
                posY = 10
            end
        end
        self.mUINode:setPositionX( posX )
        self.mUINode:setPositionY( posY )
    end

    ccui.Helper:doLayout( self._scrollViewTemp )
    self._scrollViewTemp:forceDoLayout()
    ccui.Helper:doLayout( self.mUINode )
end

-- 根据btn名字返回控件
function newFloatTipsView:getBtnByName( btnName )
    return self._btnTips:getBtnByName( btnName )
end

-- 子node点击回调
function newFloatTipsView:_clickCb( op, ... )
    local data = ...
    -- dump( data, " ------------->>>> newFloatTipsView:_clickCb " .. op )
    if "goto_feature" == op then
        display.resourceGotoFeature(data)
        self:hide(Enums.TIPS_HIDE.GOTO)
    end
end

return newFloatTipsView
